fix: secret scanning broken in Docker — missing git binary + exit code ambiguity#202
Merged
Merged
Conversation
…e ambiguity Root cause of #189: The Docker runtime image was missing the `git` binary. gitleaks git mode shells out to `git` to traverse commit history — without it, gitleaks exits 1 with an empty report. The proxy misread exit 1 as "findings present, read report", got an empty list, and silently passed. Secondary fix: use --exit-code 2 so gitleaks findings produce exit 2, making runtime errors (exit 1) unambiguous from clean scans (exit 0). Fail-closed: when secret-scan is enabled and the scanner errors or is unavailable, the push is now blocked with a clear message instead of silently passing. Smoke tests upgraded: fake truncated PEM keys replaced with real keys from openssl/ssh-keygen (with fallback detection). Added PKCS#8 (BEGIN PRIVATE KEY) alongside PKCS#1 (BEGIN RSA PRIVATE KEY). CI: docker-smoke-test job now runs as a matrix across db: [default, postgres, mongo] with fail-fast: false. Fixed compose.sh to prefer docker over podman when the docker daemon is confirmed running via `docker info`, avoiding a failure on GitHub Actions ubuntu-24.04 where the podman binary exists but its socket is not running. Descriptive error on blocked /info/refs: previously returned a bare 403. closes #189 closes #200 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9fb6ee4 to
67360c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
closes #189
closes #200